package com.atguigu.bean;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @Author zhaoshuo
 * @ClassName Goods
 * @Description
 */
@Data
@Document(indexName = "atguigu")
public class Goods {
    @Id
    String id;

    @Field(name = "title", type = FieldType.Text, analyzer = "ik_max_word")
    String title;

    @Field(name = "price", type = FieldType.Double)
    Double price;

    @Field(name = "stock", type = FieldType.Integer)
    Integer stock;

    @Field(name = "saleable", type = FieldType.Boolean)
    Boolean saleable;

    @Field(name = "attr", type = FieldType.Object)
    Attr attr;
}